/*******************************************************************************
 * Copyright (c) 2000, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Author:
 *     coolair.loveU2@gmail.com
 *******************************************************************************/

package org.skyfree.ghyll.tcard.core;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * This class ...
 */

public class Process implements IProcess
{
	private String content;
	private String operation;
	private float planTime;
	private boolean isFinished;
	private String finishTime;

	public Process(String operation,String content,float planTime)
	{
		this.operation = operation;
		this.content = content;
		this.planTime = planTime;
	}
	
	@Override
	public String getContent()
	{
		return this.content;
	}

	@Override
	public String getOperation()
	{
		return this.operation;
	}

	@Override
	public float getPlanTime()
	{
		return this.planTime;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setOperation(String operation) {
		this.operation = operation;
	}

	public void setPlanTime(float planTime) {
		this.planTime = planTime;
	}

	
	@Override
	public boolean isFinished()
	{
		return this.isFinished;
	}

	@Override
	public void setFinished(boolean finished) 
	{
		this.isFinished = finished;
		if(this.isFinished)this.finishTime = SimpleDateFormat.getInstance().format(Calendar.getInstance().getTime());
		else
		{
			this.finishTime = null;
		}
	}

	public void setFinished(String time)
	{
		this.isFinished = true;
		this.finishTime = time;
	}
	
	@Override
	public String getFinishDate() 
	{
		return this.finishTime;
	}

}
